﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FinalCRM.App_Code;

namespace FinalCRM
{
    public partial class CustomerAccount : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<ArrangeAccountID> id = ArrangeAccountID.getAccountID();
            ddlUpdateCustomerAccountAccountID.DataSource = id;
            ddlUpdateCustomerAccountAccountID.DataTextField = "AccountID";
            ddlUpdateCustomerAccountAccountID.DataValueField = "AccountID";
            ddlUpdateCustomerAccountAccountID.DataBind();

        }

        protected void btnCustomerAccountCreate_Click(object sender, EventArgs e)
        {
            CustomerAccountBusinessObject cust = new CustomerAccountBusinessObject();
            cust.AccountID = txtCreateCustomerAccountAccountID.Text;
            cust.CompanyName = txtCreateCustomerAccountCompanyName.Text;
            cust.BillingAddress = txtCustomerAccountBillingAddress.Text;
            cust.ShippingAddress = txtCreateCustomerAccountShippingAddress.Text;
            cust.Email = txtCreateCustomerAccountEmail.Text;
            cust.ContactNo = txtCreateCustomerAccountContactNo.Text;
            cust.CustomerID = txtCreateCustomerAccountCustomerID.Text;
            cust.Description = txtCreateCustomerAccountDescription.Text;
            cust.Gender = ddlCreateUserAccountGender.SelectedValue;
            cust.DateOfBirth = CreateCustomerAccountTE.Text;
            cust.UserName = txtCreateCustomerAccountUserName.Text;
            CustomerAccountBusinessObject.InsertCustomerList(cust);
            CustomerAccountGV.DataBind();
        }

        protected void ASPxPageControl1_ActiveTabChanged(object source, DevExpress.Web.ASPxTabControl.TabControlEventArgs e)
        {

        }
    }
}